<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2024/10/9
  Time: 09:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%
    String path= request.getContextPath();
%>
<html>
<head>
    <title>${title1}---${title2}</title>
</head>
<body>

<div id="text" style="min-height: 50px;"></div>
<button onclick="findText()">String获取数据</button>
<button onclick="findObj()">对象获取数据</button>
<button onclick="findlist()">list获取数据</button>
<button onclick="findMap()">map获取数据</button>



<script src="<%=path%>/js/jquery-3.7.1.min.js"></script>
<script type="text/javascript">
    function findText(){
        $.ajax({
            url:'<%=path%>/ajax/findName.do',
            success:function (data) {
                console.log(data)
                $('#text').text(data)
            },
            data:{},
            type:'get'
        })
    }

    function findObj(){
        $.ajax({
            url:'<%=path%>/ajax/findStudent.do',
            success:function (data) {
                console.log(data)
                $('#text').text(JSON.stringify(data))
            },
            data:{},
            type:'get'
        })
    }

    function findlist(){
        $.ajax({
            url:'<%=path%>/ajax/findStudents.do',
            success:function (data) {
                console.log(data)
                $('#text').text(JSON.stringify(data))
            },
            data:{},
            type:'get'
        })
    }

    function findMap(){
        $.ajax({
            url:'<%=path%>/ajax/findMap.do',
            success:function (data) {
                console.log(data)
                $('#text').text(JSON.stringify(data))
            },
            data:{},
            type:'get'
        })
    }


</script>
</body>
</html>
